package com.zjdiepu.www.commpent.mapper.yw;

import javax.annotation.Resource;

import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.stereotype.Component;

import com.zjdiepu.www.base.core.BaseMapper;
import com.zjdiepu.www.base.enums.type.DataDicType;
import com.zjdiepu.www.commpent.RedisObjectClient;
import com.zjdiepu.www.model.base.dto.SimpleDataDictionary;
import com.zjdiepu.www.model.yw.dto.YwCarinfoEditHis;

/**
 * 项目名称：diepu-parent-biz <br/> 
 * 类名称：YwCarinfoEditHisVoMapper <br/>  
 * 类描述：按揭日报表<br/>    
 * 创建人：xiongxiaotun <br/> 
 * 创建时间：2017年4月26日 下午1:33:37  <br/>   
 * 修改人：xiongxiaotun <br/> 
 * 修改时间：2017年4月26日 下午1:33:37   <br/>  
 * 修改备注：    <br/> 
 * @version V1.0   <br/>
 */
@Component
public class YwCarinfoEditHisVoMapper extends BaseMapper<YwCarinfoEditHis>{
	@Resource
	private RedisObjectClient redisObjectClient;
	@Override
	public void mapper(RedisConnection redisConnection,YwCarinfoEditHis m) {
		if(null == m) {
			return;
		}
		
		String categoryCar = m.getCategoryCar();
		SimpleDataDictionary simpleDataDictionary3 = redisObjectClient.hGet(redisConnection, SimpleDataDictionary.class.getSimpleName(), categoryCar, DataDicType.CAR_CATEGORY.getCode());
		m.setCategoryCarDisplay(simpleDataDictionary3 == null ? "" : simpleDataDictionary3.getName());
		
		String colorCar = m.getColorCar();
		SimpleDataDictionary simpleDataDictionary4 = redisObjectClient.hGet(redisConnection, SimpleDataDictionary.class.getSimpleName(), colorCar, DataDicType.CAR_COLOR.getCode());
		m.setColorCarDisplay(simpleDataDictionary4 == null ? "" : simpleDataDictionary4.getName());
	}
}
